UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zhyoeIze74+JsPnWdRslJnSHdYadjT+y8pU+Q5LUykM='
WHERE
key_id = '3d179b0e298f54c0590fa6938b3e7e3ee3994cdd529dbdf779555b8eacffc778'
AND (
token = 'zhyoeIze74+JsPnWdRslJnSHdYadjT+y8pU+Q5LUykM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)