UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SNZLmTByVNXr3XMWmQkX6JaKJs65gwnEdZuPzlLBQ8A='
WHERE
key_id = 'a3006c81cf1946e34af36c05eb02bb5128f961dac31ef29fe2363eb7482119de'
AND (
token = 'SNZLmTByVNXr3XMWmQkX6JaKJs65gwnEdZuPzlLBQ8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)