UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bLZyX3NwI0uaHuzCTW97u08+m3nCPlBcfN6ZhyYJx+c='
WHERE
key_id = '2119db1e11b82ae064aa717ead1eb9a18431cdfc27942eda55299caab1234bb6'
AND (
token = 'bLZyX3NwI0uaHuzCTW97u08+m3nCPlBcfN6ZhyYJx+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)