UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sScecRJGtwPdQzPJcIt9fV/y8PmVmUDb5l3B/xpdO4U='
WHERE
key_id = '18fa4d678f3088e71216575307bad2afbf20a2bcaa3f2426518e80d25e673df0'
AND (
token = 'sScecRJGtwPdQzPJcIt9fV/y8PmVmUDb5l3B/xpdO4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)