UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2AK3G5MxtnchiMQ0CMQLnfpnIlkeyGCUMUtGuLHiB+M='
WHERE
key_id = 'dde6bfe0a0814ce4fc9844355bf202043cde8962bb7050a6a9fba0b1f95b672e'
AND (
token = '2AK3G5MxtnchiMQ0CMQLnfpnIlkeyGCUMUtGuLHiB+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)