UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wr5Mn10ClZnQUnKonbT3CjmbjyqTMtCZtysprC9MBhw='
WHERE
key_id = '5659e62efe8bfce9ff19040f58659e9b18dc31eb657c6f65aab79f020161ca98'
AND (
token = 'wr5Mn10ClZnQUnKonbT3CjmbjyqTMtCZtysprC9MBhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)