UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fgvOofo0d1Q/Tp11ujBLIDuCx8yYoPHgACeuqUGylo='
WHERE
key_id = '72b4a7c552c217efad769690272c0c0ee89a6fae805c00b8fded71b3fffd1cbc'
AND (
token = '1fgvOofo0d1Q/Tp11ujBLIDuCx8yYoPHgACeuqUGylo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)