UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jO5584V+qLmweC7bpFweTXf46QoJLFRr/GAW/IRdfWo='
WHERE
key_id = '0c2335765d768c1c664cdb6558f83c2ee4511f5b6e66d26f2691aa4584702c83'
AND (
token = 'jO5584V+qLmweC7bpFweTXf46QoJLFRr/GAW/IRdfWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)