UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w/dGwv8GlIjf4hPCMsQqIT1/UWbPNlSoseVCpdQsTWw=' 
WHERE 
  key_id = '8c3184036d74f467958ae72c2cc0901345a6a4785e8f165428188dc49af7f9f0' 
  AND (
    token = 'w/dGwv8GlIjf4hPCMsQqIT1/UWbPNlSoseVCpdQsTWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050