UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yPjGIQyISjneeWi6U2dsPuD3yqlozTMPgyUeG7T8yhg=' 
WHERE 
  key_id = '448932080779f7048eb0db227c0822512072ea14aea8b06522c560daa59eb1c8' 
  AND (
    token = 'yPjGIQyISjneeWi6U2dsPuD3yqlozTMPgyUeG7T8yhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032