UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n+pLy0ihGBERGqsVzFFw0Un6OsvWtJZ8SB/LP+wdHd0=' 
WHERE 
  key_id = '2183078a110a6d5e5b6d20183901624b6bc91d58e35ee3cd57bd1d500e4cbda5' 
  AND (
    token = 'n+pLy0ihGBERGqsVzFFw0Un6OsvWtJZ8SB/LP+wdHd0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032