UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EfHXACfX4E2HBdpSS3Ec44PykxTWJaxt8MbxfJCXJEw=' 
WHERE 
  key_id = '577ff50a9072fedbac6edc59b4fc49c60f50fea1df4166ed347f27925c4b70ca' 
  AND (
    token = 'EfHXACfX4E2HBdpSS3Ec44PykxTWJaxt8MbxfJCXJEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032