UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2MSQelae51tgun6PYg7+sTs9YppWeUynFUALRp1eRv4='
WHERE
key_id = '06c89c3c53b060ea10abdbfb02feda20cddb9b9b5679532a09feb2ed79a32729'
AND (
token = '2MSQelae51tgun6PYg7+sTs9YppWeUynFUALRp1eRv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)