UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g8dtYrGurmuH4LzcZGLasiPQfg3GKDWfXPMeZ72fVWo='
WHERE
key_id = '239faadc66643387ebcf28d77cfa2184e3cc3df9d2896870cc23ec4f7abc37af'
AND (
token = 'g8dtYrGurmuH4LzcZGLasiPQfg3GKDWfXPMeZ72fVWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)