UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTUNJ6RrTsYYhZJpF9Biv1AnrT/FYCu5d2WT81DIpH0='
WHERE
key_id = 'e2009cdf4330e13f0e41ada09119ec2b0f350a8fdd128ecf4d444328cd750f9e'
AND (
token = 'wTUNJ6RrTsYYhZJpF9Biv1AnrT/FYCu5d2WT81DIpH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)