UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPd+7w3+g0Tp2dR/LBzoiDdeD9ndvitzx43OlD+UNBE=' 
WHERE 
  key_id = '0aa8fe15a22ecb593fab31e3822bd656b2ac4758a8738a6650d76cc498cefdd7' 
  AND (
    token = 'uPd+7w3+g0Tp2dR/LBzoiDdeD9ndvitzx43OlD+UNBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033