UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cTAaftRh1xBFltv/XP5g5I+z5nvpK3BwLQAqB1gf/7I='
WHERE
key_id = '5b5ae77fc3801f2fd19625c9b035d3e0a30b7f5496ae00b05bf2ad3972599dff'
AND (
token = 'cTAaftRh1xBFltv/XP5g5I+z5nvpK3BwLQAqB1gf/7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)