UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IOv6U213I+8YMM/3hBDMmlPwoxx7tejxbOvOmKmpQ38=' 
WHERE 
  key_id = '7b0915e24332646c587962f9c1100adf03269b9d0b3c61756ae16097124eb58b' 
  AND (
    token = 'IOv6U213I+8YMM/3hBDMmlPwoxx7tejxbOvOmKmpQ38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00242