UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XU7KhHNTgz16STJ4UgZFMQ5oHn3jtYa931WycOZgCjc='
WHERE
key_id = '206ba3b212f2c56ccd332ce69318702aaff8a2619b7dcec5720ee0d9bfee2f23'
AND (
token = 'XU7KhHNTgz16STJ4UgZFMQ5oHn3jtYa931WycOZgCjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)