UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u5AaO2lTZuwxt65KzPwsjuwayE93qPBouU6aF4W5/JU='
WHERE
key_id = '12ca4b832d1aee4fce70d84164d79dae3f9e5524361c4f09c3f6a82fc4c407b9'
AND (
token = 'u5AaO2lTZuwxt65KzPwsjuwayE93qPBouU6aF4W5/JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)