UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9aHDwyW0ScgGAAnM3B0UNiQv5X+BqMjGmQmG0ql/3us='
WHERE
key_id = '04099dd19c696b4ffc5feb0aeaa0aa1a8221c21086541159258efd302295003c'
AND (
token = '9aHDwyW0ScgGAAnM3B0UNiQv5X+BqMjGmQmG0ql/3us='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)