UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9oFULdjX1BFd2g2I651q/Ha4tR9StNh0q3Z+yvR+Xss='
WHERE
key_id = '78841b8d024c34b85adc308b6305eeaa6115efca025bfe05693b6bb4238e937d'
AND (
token = '9oFULdjX1BFd2g2I651q/Ha4tR9StNh0q3Z+yvR+Xss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)