UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBaiu/mgvdLe3W04/XhfRIKcFPV8Jm3C1GwTLdzSOgw='
WHERE
key_id = 'ab09e56da1787b55ba0e9d3e8216aa9916d1ca281dd0351da785cb59ae5b72a0'
AND (
token = 'JBaiu/mgvdLe3W04/XhfRIKcFPV8Jm3C1GwTLdzSOgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)