UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZS7288IZgrHX6IF6ss9XtejRKJAxxgNyIWhVUzy68U='
WHERE
key_id = '00ceed3e622786ef55c24ce392b1d08b0d18aac90fdc12afb25a2e40a61665d1'
AND (
token = 'eZS7288IZgrHX6IF6ss9XtejRKJAxxgNyIWhVUzy68U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)