UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UJ7SjsUI8A3MfJOn7KG/+rJHDAdgK/7PBPcVU5kU7Cc='
WHERE
key_id = '9942c748fabc3e3bcd8ac6290489936f730d402ebe4d2ba77bf3819ac3e281e1'
AND (
token = 'UJ7SjsUI8A3MfJOn7KG/+rJHDAdgK/7PBPcVU5kU7Cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)