UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g86gnNLco/77PBmNFxUqRgPpolZxQb1QPC7o/F85XMc='
WHERE
key_id = 'edcc049181547fce5efa7d7d7234487f35387988760e1715f951f44ff1dd0d64'
AND (
token = 'g86gnNLco/77PBmNFxUqRgPpolZxQb1QPC7o/F85XMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)