UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1wXpSHs6F0YiXmHcqRf7rqMnanqzyPwQgZbC+xlm7+Q='
WHERE
key_id = 'ef1156074e74679e089c39d9d2447b1d815c4c1d6dbaa46e6fc1589efac27c5b'
AND (
token = '1wXpSHs6F0YiXmHcqRf7rqMnanqzyPwQgZbC+xlm7+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)