UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lXfomVyDHHIz4TDJHwJA4g3xK3GW6oGJFBX34sy5K1Q=' 
WHERE 
  key_id = 'c1f725cf3f87e1f1d575a323d9bbb1c831dae0efe3af6fb3b839ca8109b8e9aa' 
  AND (
    token = 'lXfomVyDHHIz4TDJHwJA4g3xK3GW6oGJFBX34sy5K1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029