UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vC4wCQZqMthFJVz6hp6W36tggjA3kdXmtSklHs9xWeA='
WHERE
key_id = 'd8706ed600fa354ac5cd0c6525b47674cc5e247a322270d60ce9fc159251f30c'
AND (
token = 'vC4wCQZqMthFJVz6hp6W36tggjA3kdXmtSklHs9xWeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)