UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DMW2FzSZTpJlxlJB9p+psvRVsTt+oAq9rj8Ys1kuFSA='
WHERE
key_id = 'cc57e0fb9e388f0e62e539e215ae7c51deb9d07e0e32ffabfba95bcc65a5f426'
AND (
token = 'DMW2FzSZTpJlxlJB9p+psvRVsTt+oAq9rj8Ys1kuFSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)