UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cT8SFxVPJTQ50aDNRZtFfJfh5Ci4ofsbSvXM14YnkiQ='
WHERE
key_id = '5ca7c1d4988d10f0319b5507ec01848cf16274c9c7d12060642b5e9781f7feb4'
AND (
token = 'cT8SFxVPJTQ50aDNRZtFfJfh5Ci4ofsbSvXM14YnkiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)