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