UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '805Gg0HihRrZVaGToYF0uFCFvE22X28psIWqVxBBBsQ='
WHERE
key_id = '5f02b1f25bc4f61114b798c4efd710d95733e722cb3d07019d6949a58eaad46e'
AND (
token = '805Gg0HihRrZVaGToYF0uFCFvE22X28psIWqVxBBBsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)