UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wSDTQx7TdyqH34b3u+EnLsUEoihvCb3QHUO5gRrguGQ='
WHERE
key_id = 'b9ca29bf9aa58b5cf4ad79bd1f2b960a1a6e1e65960bfec1ba2764401b9cdeff'
AND (
token = 'wSDTQx7TdyqH34b3u+EnLsUEoihvCb3QHUO5gRrguGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)