UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eJN/YjjfkQGpALC2jLLPcZzuaZmltbEY8Rq/aEqiof0=' 
WHERE 
  key_id = '27c75c91a5c8e9c9633c88a4bf4c195f405e37142df5055f00b7350f46d94574' 
  AND (
    token = 'eJN/YjjfkQGpALC2jLLPcZzuaZmltbEY8Rq/aEqiof0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022