UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XKMKU5bsliYgmzWxjhuTVUuaMRoaSGOwhcJySIRrqhg='
WHERE
key_id = '158946f2e60b1f53f62f09ec72da351bb6ce8c42de93740378016d9d72964487'
AND (
token = 'XKMKU5bsliYgmzWxjhuTVUuaMRoaSGOwhcJySIRrqhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)