UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRCv4azgbqdo6Urdbq3+w2rGd99e+afcrKLYq/zrJYo='
WHERE
key_id = '5a8db6020dcd3ec228506aff478a1c26afd2ff9c1ea3e2ccc02678dd3c5a83d6'
AND (
token = 'WRCv4azgbqdo6Urdbq3+w2rGd99e+afcrKLYq/zrJYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)