UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ej4YLdzETMd7f0+fYQjR2auq3eafh4XeaoPveVeQwm0=' 
WHERE 
  key_id = '592eee603c013db0d999edcffd42204135f5556ba641ae278f001bab9688dd56' 
  AND (
    token = 'ej4YLdzETMd7f0+fYQjR2auq3eafh4XeaoPveVeQwm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039