UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K5nUN/HnH+VHpdcrYxmarre32TSO/0gslzuX3T7qd08='
WHERE
key_id = '5e4eb2af666eb0535c5fffb796107129590fa081919213e1f0e80305267767b1'
AND (
token = 'K5nUN/HnH+VHpdcrYxmarre32TSO/0gslzuX3T7qd08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)