UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QYa+CYU7/cny8Z1Vz2Zvuhv+fpPt2SN4q5X/4gMzP6I=' 
WHERE 
  key_id = 'e472798f06a6283eb3242ae8b250fdedde27245ea2d054fe06a5414627418a61' 
  AND (
    token = 'QYa+CYU7/cny8Z1Vz2Zvuhv+fpPt2SN4q5X/4gMzP6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051