UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OzTLgZ5qJ4wluUrD1iqimGM9yce8l+QhZIhnBp+SsDY='
WHERE
key_id = 'e3f47208f93624e9e2a46fbbeb2b6f66c539aaa5e996f72374817dad49349f04'
AND (
token = 'OzTLgZ5qJ4wluUrD1iqimGM9yce8l+QhZIhnBp+SsDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)