UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qJEXA+PIiFk+2s9Pu8DJJcByduVZYRc6FCkaJaVo9hc='
WHERE
key_id = '852d85d9fe1d9e75def9cb25c780b64d9ac1dbbb5c335f7254cdf251d154747e'
AND (
token = 'qJEXA+PIiFk+2s9Pu8DJJcByduVZYRc6FCkaJaVo9hc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)