UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q2GSBHWnQ/x9kHKoOwCblEwUMIpqSVP9Wuzx71vrRVA=' 
WHERE 
  key_id = '443094a603d0fdd85375f9a9e12a4b2fd9130a34950da30401203b8fa56e44f6' 
  AND (
    token = 'q2GSBHWnQ/x9kHKoOwCblEwUMIpqSVP9Wuzx71vrRVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038