UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ohgzZ3JzV+FyooWwW5YLjGUAjMCt/8TmgWVKLA0S0w0='
WHERE
key_id = 'ff23a43a18dbd319a84e0b9eb4896b89c10d50e6fc0db93e69835aaba34f1ff4'
AND (
token = 'ohgzZ3JzV+FyooWwW5YLjGUAjMCt/8TmgWVKLA0S0w0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)