UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ObXj/lnQpOgio/V/l724wOUn4mxrlofgpTzytRcBDuA=' 
WHERE 
  key_id = '8f0a5304772a9d042fe6ece86c7cc53de50edb81ac0f5ba8f44da66fd5f5fe05' 
  AND (
    token = 'ObXj/lnQpOgio/V/l724wOUn4mxrlofgpTzytRcBDuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041