UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HjwsDiP/NweC9QwtSUqJq8mxlqxCQoMMWgUFuTE8o1o='
WHERE
key_id = 'cc89130eb413425ba2825a063b01a45d26ed2fbe8549c137c5bf4af35c46391c'
AND (
token = 'HjwsDiP/NweC9QwtSUqJq8mxlqxCQoMMWgUFuTE8o1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)