UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SwvBCIW1/EMJKzqtNhLFSdmnnQKDtcFQnfXPMAwxST8='
WHERE
key_id = '86c3ce7a75d2543e5d87bdc788b978c38c3e699c52077d4604c15b98340ff47c'
AND (
token = 'SwvBCIW1/EMJKzqtNhLFSdmnnQKDtcFQnfXPMAwxST8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)