UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3AbIXDmtLrBiOl8j2hxlzD/Ddxm1+SIfHqh1sJzqkUU=' 
WHERE 
  key_id = '384b0fb63564d752c41522467cee641083c76574b31b5a0da6c61e8a2d6d0d8e' 
  AND (
    token = '3AbIXDmtLrBiOl8j2hxlzD/Ddxm1+SIfHqh1sJzqkUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025