UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'llOE0A/gdGWKzOJH0hLBh9JzlhcyqH9zWx3/RMYyAMY='
WHERE
key_id = 'aae18891bcc7d1a03503bd5f9da57d4bffebbab2ac4d1a9166bf82db9eefa8b2'
AND (
token = 'llOE0A/gdGWKzOJH0hLBh9JzlhcyqH9zWx3/RMYyAMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)