UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qNC7CXt0JmqsD1ocRzAlfz5tgdXVwyNe4rK/w74W6BE='
WHERE
key_id = '8059f1ee1fe559097f83dba9f444b0869d9873c73cfd98887f3adee5bfd31c75'
AND (
token = 'qNC7CXt0JmqsD1ocRzAlfz5tgdXVwyNe4rK/w74W6BE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)